package com.bojx.report.service;

import java.util.ArrayList;
import java.util.List;

import com.bojx.report.dao.QueryDao;
import com.bojx.report.pojo.Constant;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

public class QueryService {
	private static QueryDao dao=new QueryDao();
	public  Record queryData(String bankName,int year ,int month){
		Record result=new Record();
		//1查询银行网点情况
		List<Record> bankBranchData=dao.findBankBranchData(bankName, year, month);
		result.set("bankBranchData", bankBranchData);
		//2查询客户情况
		List<Record>  clientData=dao.findClientData(bankName,year,month);
		result.set("clientData", clientData);
		//3查询业务量
		List<String> areas=dao.findAreaData();
		//查询本期发生
		List<Record> currentRecords=new ArrayList<Record>();
		result.set("currentRecords", currentRecords);
		for(String area:areas){
			Record currentRecord=new Record();
			currentRecord.set("area", area);
			currentRecords.add(currentRecord);
			//电子商业承兑汇票
			//1.签发
			Record caEdraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.ISSUE,Constant.CURRENT);
			int caEdraftIssueQty=caEdraftIssueRecord.getInt("qty");
			float  caEdraftIssueAmt=caEdraftIssueRecord.getFloat("amt");
			currentRecord.set("caEdraftIssueQty", caEdraftIssueQty);
			currentRecord.set("caEdraftIssueAmt", caEdraftIssueAmt);
			//2.贴现
			Record caEdraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.DISCOUNT,Constant.CURRENT);
			int caEdraftDiscountQty=caEdraftDiscountRecord.getInt("qty");
			float  caEdraftDiscountAmt=caEdraftDiscountRecord.getFloat("amt");
			currentRecord.set("caEdraftDiscountQty", caEdraftDiscountQty);
			currentRecord.set("caEdraftDiscountAmt", caEdraftDiscountAmt);
			//3.转贴现
			Record caEdraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.REDISCOUNT,Constant.CURRENT);
			int caEdraftReDiscountQty=caEdraftReDiscountRecord.getInt("qty");
			float  caEdraftReDiscountAmt=caEdraftReDiscountRecord.getFloat("amt");
			currentRecord.set("caEdraftReDiscountQty", caEdraftReDiscountQty);
			currentRecord.set("caEdraftReDiscountAmt", caEdraftReDiscountAmt);
			//电子银行承兑汇票
			//1.签发
			Record baEdraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.ISSUE,Constant.CURRENT);
			int baEdraftIssueQty=baEdraftIssueRecord.getInt("qty");
			float  baEdraftIssueAmt=baEdraftIssueRecord.getFloat("amt");
			currentRecord.set("baEdraftIssueQty", baEdraftIssueQty);
			currentRecord.set("baEdraftIssueAmt", baEdraftIssueAmt);
			//2.承兑
			Record baEdraftAcceptRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.ACCEPT,Constant.CURRENT);
			int baEdraftAcceptQty=baEdraftAcceptRecord.getInt("qty");
			float  baEdraftAcceptAmt=baEdraftAcceptRecord.getFloat("amt");
			currentRecord.set("baEdraftAcceptQty", baEdraftAcceptQty);
			currentRecord.set("baEdraftAcceptAmt", baEdraftAcceptAmt);
			//3.贴现
			Record baEdraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.DISCOUNT,Constant.CURRENT);
			int baEdraftDiscountQty=baEdraftDiscountRecord.getInt("qty");
			float  baEdraftDiscountAmt=baEdraftDiscountRecord.getFloat("amt");
			currentRecord.set("baEdraftDiscountQty", baEdraftDiscountQty);
			currentRecord.set("baEdraftDiscountAmt", baEdraftDiscountAmt);
			//4.转贴现
			Record baEdraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.REDISCOUNT,Constant.CURRENT);
			int baEdraftReDiscountQty=baEdraftReDiscountRecord.getInt("qty");
			float  baEdraftReDiscountAmt=baEdraftReDiscountRecord.getFloat("amt");
			currentRecord.set("baEdraftReDiscountQty", baEdraftReDiscountQty);
			currentRecord.set("baEdraftReDiscountAmt", baEdraftReDiscountAmt);
			
			//全部商业承兑汇票
			//1.签发
			Record caDraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.ISSUE,Constant.CURRENT);
			int caDraftIssueQty=caDraftIssueRecord.getInt("qty");
			float  caDraftIssueAmt=caDraftIssueRecord.getFloat("amt");
			currentRecord.set("caDraftIssueQty", caDraftIssueQty);
			currentRecord.set("caDraftIssueAmt", caDraftIssueAmt);
			//2.贴现
			Record caDraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.DISCOUNT,Constant.CURRENT);
			int caDraftDiscountQty=caDraftDiscountRecord.getInt("qty");
			float  caDraftDiscountAmt=caDraftDiscountRecord.getFloat("amt");
			currentRecord.set("caDraftDiscountQty", caDraftDiscountQty);
			currentRecord.set("caDraftDiscountAmt", caDraftDiscountAmt);
			//3.转贴现
			Record caDraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.REDISCOUNT,Constant.CURRENT);
			int caDraftReDiscountQty=caDraftReDiscountRecord.getInt("qty");
			float  caDraftReDiscountAmt=caDraftReDiscountRecord.getFloat("amt");
			currentRecord.set("caDraftReDiscountQty", caDraftReDiscountQty);
			currentRecord.set("caDraftReDiscountAmt", caDraftReDiscountAmt);
			//全部银行承兑汇票
			//1.签发
			Record baDraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.ISSUE,Constant.CURRENT);
			int baDraftIssueQty=baDraftIssueRecord.getInt("qty");
			float  baDraftIssueAmt=baDraftIssueRecord.getFloat("amt");
			currentRecord.set("baDraftIssueQty", baDraftIssueQty);
			currentRecord.set("baDraftIssueAmt", baDraftIssueAmt);
			//2.承兑
			Record baDraftAcceptRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.ACCEPT,Constant.CURRENT);
			int baDraftAcceptQty=baDraftAcceptRecord.getInt("qty");
			float  baDraftAcceptAmt=baDraftAcceptRecord.getFloat("amt");
			currentRecord.set("baDraftAcceptQty", baDraftAcceptQty);
			currentRecord.set("baDraftAcceptAmt", baDraftAcceptAmt);
			//3.贴现
			Record baDraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.DISCOUNT,Constant.CURRENT);
			int baDraftDiscountQty=baDraftDiscountRecord.getInt("qty");
			float  baDraftDiscountAmt=baDraftDiscountRecord.getFloat("amt");
			currentRecord.set("baDraftDiscountQty", baDraftDiscountQty);
			currentRecord.set("baDraftDiscountAmt", baDraftDiscountAmt);
			//4.转贴现
			Record baDraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.REDISCOUNT,Constant.CURRENT);
			int baDraftReDiscountQty=baDraftReDiscountRecord.getInt("qty");
			float  baDraftReDiscountAmt=baDraftReDiscountRecord.getFloat("amt");
			currentRecord.set("baDraftReDiscountQty", baDraftReDiscountQty);
			currentRecord.set("baDraftReDiscountAmt", baDraftReDiscountAmt);
		}
		
		//查询本年累计
		List<Record> totalRecords=new ArrayList<Record>();
		result.set("totalRecords", totalRecords);
		for(String area:areas){
			Record totalRecord=new Record();
			totalRecord.set("area",area);
			totalRecords.add(totalRecord);
			//电子商业承兑汇票
			//1.签发
			Record caEdraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.ISSUE,Constant.TOTAL);
			int caEdraftIssueQty=caEdraftIssueRecord.getInt("qty");
			float  caEdraftIssueAmt=caEdraftIssueRecord.getFloat("amt");
			totalRecord.set("caEdraftIssueQty", caEdraftIssueQty);
			totalRecord.set("caEdraftIssueAmt", caEdraftIssueAmt);
			//2.贴现
			Record caEdraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.DISCOUNT,Constant.TOTAL);
			int caEdraftDiscountQty=caEdraftDiscountRecord.getInt("qty");
			float  caEdraftDiscountAmt=caEdraftDiscountRecord.getFloat("amt");
			totalRecord.set("caEdraftDiscountQty", caEdraftDiscountQty);
			totalRecord.set("caEdraftDiscountAmt", caEdraftDiscountAmt);
			//3.转贴现
			Record caEdraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CAEDRAFT,Constant.REDISCOUNT,Constant.TOTAL);
			int caEdraftReDiscountQty=caEdraftReDiscountRecord.getInt("qty");
			float  caEdraftReDiscountAmt=caEdraftReDiscountRecord.getFloat("amt");
			totalRecord.set("caEdraftReDiscountQty", caEdraftReDiscountQty);
			totalRecord.set("caEdraftReDiscountAmt", caEdraftReDiscountAmt);
			//电子银行承兑汇票
			//1.签发
			Record baEdraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.ISSUE,Constant.TOTAL);
			int baEdraftIssueQty=baEdraftIssueRecord.getInt("qty");
			float  baEdraftIssueAmt=baEdraftIssueRecord.getFloat("amt");
			totalRecord.set("baEdraftIssueQty", baEdraftIssueQty);
			totalRecord.set("baEdraftIssueAmt", baEdraftIssueAmt);
			//2.承兑
			Record baEdraftAcceptRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.ACCEPT,Constant.TOTAL);
			int baEdraftAcceptQty=baEdraftAcceptRecord.getInt("qty");
			float  baEdraftAcceptAmt=baEdraftAcceptRecord.getFloat("amt");
			totalRecord.set("baEdraftAcceptQty", baEdraftAcceptQty);
			totalRecord.set("baEdraftAcceptAmt", baEdraftAcceptAmt);
			//3.贴现
			Record baEdraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.DISCOUNT,Constant.TOTAL);
			int baEdraftDiscountQty=baEdraftDiscountRecord.getInt("qty");
			float  baEdraftDiscountAmt=baEdraftDiscountRecord.getFloat("amt");
			totalRecord.set("baEdraftDiscountQty", baEdraftDiscountQty);
			totalRecord.set("baEdraftDiscountAmt", baEdraftDiscountAmt);
			//4.转贴现
			Record baEdraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BAEDRAFT,Constant.REDISCOUNT,Constant.TOTAL);
			int baEdraftReDiscountQty=baEdraftReDiscountRecord.getInt("qty");
			float  baEdraftReDiscountAmt=baEdraftReDiscountRecord.getFloat("amt");
			totalRecord.set("baEdraftReDiscountQty", baEdraftReDiscountQty);
			totalRecord.set("baEdraftReDiscountAmt", baEdraftReDiscountAmt);
			
			//全部商业承兑汇票
			//1.签发
			Record caDraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.ISSUE,Constant.TOTAL);
			int caDraftIssueQty=caDraftIssueRecord.getInt("qty");
			float  caDraftIssueAmt=caDraftIssueRecord.getFloat("amt");
			totalRecord.set("caDraftIssueQty", caDraftIssueQty);
			totalRecord.set("caDraftIssueAmt", caDraftIssueAmt);
			//2.贴现
			Record caDraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.DISCOUNT,Constant.TOTAL);
			int caDraftDiscountQty=caDraftDiscountRecord.getInt("qty");
			float  caDraftDiscountAmt=caDraftDiscountRecord.getFloat("amt");
			totalRecord.set("caDraftDiscountQty", caDraftDiscountQty);
			totalRecord.set("caDraftDiscountAmt", caDraftDiscountAmt);
			//3.转贴现
			Record caDraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.CADRAFT,Constant.REDISCOUNT,Constant.TOTAL);
			int caDraftReDiscountQty=caDraftReDiscountRecord.getInt("qty");
			float  caDraftReDiscountAmt=caDraftReDiscountRecord.getFloat("amt");
			totalRecord.set("caDraftReDiscountQty", caDraftReDiscountQty);
			totalRecord.set("caDraftReDiscountAmt", caDraftReDiscountAmt);
			//全部银行承兑汇票
			//1.签发
			Record baDraftIssueRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.ISSUE,Constant.TOTAL);
			int baDraftIssueQty=baDraftIssueRecord.getInt("qty");
			float  baDraftIssueAmt=baDraftIssueRecord.getFloat("amt");
			totalRecord.set("baDraftIssueQty", baDraftIssueQty);
			totalRecord.set("baDraftIssueAmt", baDraftIssueAmt);
			//2.承兑
			Record baDraftAcceptRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.ACCEPT,Constant.TOTAL);
			int baDraftAcceptQty=baDraftAcceptRecord.getInt("qty");
			float  baDraftAcceptAmt=baDraftAcceptRecord.getFloat("amt");
			totalRecord.set("baDraftAcceptQty", baDraftAcceptQty);
			totalRecord.set("baDraftAcceptAmt", baDraftAcceptAmt);
			//3.贴现
			Record baDraftDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.DISCOUNT,Constant.TOTAL);
			int baDraftDiscountQty=baDraftDiscountRecord.getInt("qty");
			float  baDraftDiscountAmt=baDraftDiscountRecord.getFloat("amt");
			totalRecord.set("baDraftDiscountQty", baDraftDiscountQty);
			totalRecord.set("baDraftDiscountAmt", baDraftDiscountAmt);
			//4.转贴现
			Record baDraftReDiscountRecord=dao.queryBusinessData(area,bankName,year,month,Constant.BADRAFT,Constant.REDISCOUNT,Constant.TOTAL);
			int baDraftReDiscountQty=baDraftReDiscountRecord.getInt("qty");
			float  baDraftReDiscountAmt=baDraftReDiscountRecord.getFloat("amt");
			totalRecord.set("baDraftReDiscountQty", baDraftReDiscountQty);
			totalRecord.set("baDraftReDiscountAmt", baDraftReDiscountAmt);
		}
		
		return result;
	}
	public  Page<Record> queryExcelData(Kv queryCondition) {
		return dao.queryExcelData(queryCondition);
	}
	public Page<Record> queryQuarterExcelData(Kv queryCondition) {
		
		return dao.queryQuarterExcelData(queryCondition);
	}
	
	/***
	 * 查询季度信息
	 * @param bankName
	 * @param year
	 * @param quarter
	 * @return
	 */
	public List<List<Object>> queryQuarterData(String bank, int year, int quarter) {
	    List<List<Object>> result=new ArrayList<>();
		String[] areas=new String[]{"本级","嘉善","平湖","桐乡","海宁","海盐"};
		for(int i=0;i<6;i++){
			String area=areas[i];
			List<Object> record=new ArrayList<Object>();
			result.add(record);
			record.add(area);
			//查询
			//银行网点情况
			Record bankBranchInfo=dao.findQuarterBranchInfo(bank, area, year, quarter);
			record.add(bankBranchInfo.get("branch_qty"));
			record.add(bankBranchInfo.get("edraft_branch_qty"));
			//客户情况
			Record bankClientInfo=dao.findQuarterClientInfo(bank, area, year, quarter);
			record.add(bankClientInfo.get("euser_qty"));
			record.add(bankClientInfo.get("ebank_euser_qty"));
			record.add(bankClientInfo.get("draft_euser_qty"));
			record.add(bankClientInfo.get("edraft_euser_qty"));
			//业务量
			//电子银行承兑汇票承兑
			Record baEDraftAcceptless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftAccept, Constant.less50);
			record.add(baEDraftAcceptless50.get("qty"));
			record.add(baEDraftAcceptless50.get("amt"));
			
			Record baEDraftAcceptBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftAccept, Constant.bet50To100);
			record.add(baEDraftAcceptBet50To100.get("qty"));
			record.add(baEDraftAcceptBet50To100.get("amt"));
			
			Record baEDraftAcceptBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftAccept, Constant.bet100To300);
			record.add(baEDraftAcceptBet100To300.get("qty"));
			record.add(baEDraftAcceptBet100To300.get("amt"));
			
			Record baEDraftAcceptGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftAccept, Constant.gt300);
			record.add(baEDraftAcceptGt300.get("qty"));
			record.add(baEDraftAcceptGt300.get("amt"));
			
			//电子银行承兑汇票贴现
			Record baEDraftDiscountless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftDiscount, Constant.less50);
			record.add(baEDraftDiscountless50.get("qty"));
			record.add(baEDraftDiscountless50.get("amt"));
			
			Record baEDraftDiscountBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftDiscount, Constant.bet50To100);
			record.add(baEDraftDiscountBet50To100.get("qty"));
			record.add(baEDraftDiscountBet50To100.get("amt"));
			
			Record baEDraftDiscountBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftDiscount, Constant.bet100To300);
			record.add(baEDraftDiscountBet100To300.get("qty"));
			record.add(baEDraftDiscountBet100To300.get("amt"));
			
			Record baEDraftDiscountGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baEdraftDiscount, Constant.gt300);
			record.add(baEDraftDiscountGt300.get("qty"));
			record.add(baEDraftDiscountGt300.get("amt"));
			
			
			//纸质银行承兑汇票承兑
			Record baDraftAcceptless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftAccept, Constant.less50);
			record.add(baDraftAcceptless50.get("qty"));
			record.add(baDraftAcceptless50.get("amt"));
			
			Record baDraftAcceptBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftAccept, Constant.bet50To100);
			record.add(baDraftAcceptBet50To100.get("qty"));
			record.add(baDraftAcceptBet50To100.get("amt"));
			
			Record baDraftAcceptBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftAccept, Constant.bet100To300);
			record.add(baDraftAcceptBet100To300.get("qty"));
			record.add(baDraftAcceptBet100To300.get("amt"));
			
			Record baDraftAcceptGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftAccept, Constant.gt300);
			record.add(baDraftAcceptGt300.get("qty"));
			record.add(baDraftAcceptGt300.get("amt"));
			
			//纸质银行承兑汇票贴现
			Record baDraftDiscountless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftDiscount, Constant.less50);
			record.add(baDraftDiscountless50.get("qty"));
			record.add(baDraftDiscountless50.get("amt"));
			
			Record baDraftDiscountBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftDiscount, Constant.bet50To100);
			record.add(baDraftDiscountBet50To100.get("qty"));
			record.add(baDraftDiscountBet50To100.get("amt"));
			
			Record baDraftDiscountBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftDiscount, Constant.bet100To300);
			record.add(baDraftDiscountBet100To300.get("qty"));
			record.add(baDraftDiscountBet100To300.get("amt"));
			
			Record baDraftDiscountGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.baDraftDiscount, Constant.gt300);
			record.add(baDraftDiscountGt300.get("qty"));
			record.add(baDraftDiscountGt300.get("amt"));
			
			
			//电子商业承兑汇票贴现
			Record caEDraftDiscountless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caEdraftDiscount, Constant.less50);
			record.add(caEDraftDiscountless50.get("qty"));
			record.add(caEDraftDiscountless50.get("amt"));
			
			Record caEDraftDiscountBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caEdraftDiscount, Constant.bet50To100);
			record.add(caEDraftDiscountBet50To100.get("qty"));
			record.add(caEDraftDiscountBet50To100.get("amt"));
			
			Record caEDraftDiscountBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caEdraftDiscount, Constant.bet100To300);
			record.add(caEDraftDiscountBet100To300.get("qty"));
			record.add(caEDraftDiscountBet100To300.get("amt"));
			
			Record caEDraftDiscountGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caEdraftDiscount, Constant.gt300);
			record.add(caEDraftDiscountGt300.get("qty"));
			record.add(caEDraftDiscountGt300.get("amt"));
			
			//纸质商业承兑汇票贴现
			Record caDraftDiscountless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caDraftDiscount, Constant.less50);
			record.add(caDraftDiscountless50.get("qty"));
			record.add(caDraftDiscountless50.get("amt"));
			
			Record caDraftDiscountBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caDraftDiscount, Constant.bet50To100);
			record.add(caDraftDiscountBet50To100.get("qty"));
			record.add(caDraftDiscountBet50To100.get("amt"));
			
			Record caDraftDiscountBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caDraftDiscount, Constant.bet100To300);
			record.add(caDraftDiscountBet100To300.get("qty"));
			record.add(caDraftDiscountBet100To300.get("amt"));
			
			Record caDraftDiscountGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.caDraftDiscount, Constant.gt300);
			record.add(caDraftDiscountGt300.get("qty"));
			record.add(caDraftDiscountGt300.get("amt"));
			
			//商业汇票再贴现
			Record DraftReDiscountless50=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.draftRediscount, Constant.less50);
			record.add(DraftReDiscountless50.get("qty"));
			record.add(DraftReDiscountless50.get("amt"));
			
			Record DraftReDiscountBet50To100=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.draftRediscount, Constant.bet50To100);
			record.add(DraftReDiscountBet50To100.get("qty"));
			record.add(DraftReDiscountBet50To100.get("amt"));
			
			Record DraftReDiscountBet100To300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.draftRediscount, Constant.bet100To300);
			record.add(DraftReDiscountBet100To300.get("qty"));
			record.add(DraftReDiscountBet100To300.get("amt"));
			
			Record DraftReDiscountGt300=dao.findQuarterBusinessData(bank, area, year
					,quarter, Constant.draftRediscount, Constant.gt300);
			record.add(DraftReDiscountGt300.get("qty"));
			record.add(DraftReDiscountGt300.get("amt"));
		}
		return result;
	}
}
